package com.zjyd.douyangcommoncore.vo;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Pattern;
import jakarta.validation.constraints.Size;
import lombok.Data;

@Schema(description = "用户注册VO")
@Data
public class DyUsersRegisterByPasswordVO {
    /**
     * 用户名
     * 不能大于20位
     */
    @NotBlank(message = "用户名不能为空")
    @Size(min = 4, max = 20, message = "用户名长度不能小于4位，不能大于20位")
    @Schema(description = "用户名", requiredMode = Schema.RequiredMode.REQUIRED)
    private String username;

    /**
     * 密码
     */
    @NotBlank(message = "密码不能为空") // 非空校验
    @Pattern(regexp = "^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d)(?=.*[\\W_]).+$",
             message = "密码必须包含大小写字母、数字和特殊字符")
    @Size(min = 12, max = 20, message = "密码长度不能小于12位，不能大于20位")
    @Schema(description = "密码", requiredMode = Schema.RequiredMode.REQUIRED)
    private String password;

}
